package com.cskaoyan.exception;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;



@RestControllerAdvice
public class ExceptionControllerAdvice {

    @ExceptionHandler(CustomValidationException.class)

    public BaseRespVo exception(CustomValidationException exception) {//抛出的异常可以在形参中接收
        return BaseRespVo.fail(exception.getMessage());
    }


}
